package vn.fpt.fsoft.coreframework;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Point;

public class Missile {
    //Properties
    private char   direction;    // Hướng hiện tại của missile 
    private Point  position;     // Vị trí hiện tại của missile
    private Color  color;        // Màu sắc của missile
    //Contructor
    public Missile(char direction,Point position) {
        super();
        this.direction = direction;
        this.position = position;
    }
    //Getters & Setters
    public char getDirection() {
        return direction;
    }
    public void setDirection(char direction) {
        this.direction = direction;
    }
    public Point getPosition() {
        return position;
    }
    public void setPosition(Point position) {
        this.position = position;
    }
    public Color getColor() {
        return color;
    }
    public void setColor(Color color) {
        this.color = color;
    }
    //Methods
    public void initMissile(){
        this.direction = 'B';
        this.position = new Point(this.position.x, this.position.y);
        this.color = new Color(255,0,0);
    }
    public void draw(Graphics2D g){
        g.setColor(new Color(255,0,0));
        g.drawRoundRect(this.getPosition().x+15,this.getPosition().y-21, 20, 20, 1, 1);
        g.fillRoundRect(this.getPosition().x+15,this.getPosition().y-21, 20, 20, 1, 1);
    }
    
    
}
